<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@include file="/ui/jsp/includes/includes.jspf"%>
<%@include file="/ui/jsp/includes/noNavHeader.jspf"%>
<script type="text/javascript">
function checkAnswer()
{	
	$('#securityCheckForm').attr('action', 'SecurityCheckTwo.html');
	$('#securityCheckForm').submit();
}
function cancel()
{
	$('#securityCheckForm').attr('action', 'Dashboard.html');
	$('#securityCheckForm').submit();
}

$(document).ready(function() {
	$('#errorDiv').hide();
});
</script>
<div class="hero-unit secondary_container">
	<form:form id="securityCheckForm" method="POST" commandName="userLogin"  cssClass="form-horizontal" onkeypress="if(event.keyCode == 13) {javascript:checkAnswer();}">
		<div id="errorDiv" class="errorblock"></div>
		<label>Please answer the question below.<br/></label>
		<div class="control-group">
			<label class="controls" for="userName">User Name: ${userLogin.userName}</label>
			
		</div>
		<div class="control-group">
			<label class="controls" for="securityQuestion">Security Question:<br/>${userLogin.securityQuestion}</label>
			<br/>
			
		</div>
		<div class="control-group">
			<label class="control-label" for="securityAnswer">Security Answer</label>
			<div class="controls">
				<form:input id="securityAnswer" path="securityAnswer" autocomplete="off"></form:input>
			</div>
		</div>
		<div class="control-group">
			<div class="controls" tabindex="0">
				<input type="button" id="button1" onclick="{javascript:checkAnswer();}" value="Submit" class="btn btn-primary"/>
				<input type="button" id="button2" onclick="{javascript:cancel();}" value="Cancel" class="btn btn-primary"/>
			</div>
		</div>
		<form:hidden id="userLoginId" path="userLoginId" value="${userLogin.userLoginId}"/>
		<form:hidden id="userName" path="userName" value="${userLogin.userName}"/>
	</form:form>
</div>
<%@include file="/ui/jsp/includes/footer.jspf"%>
